home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c
- Path: howland.reston.ans.net!torn!sq!msb
- From: msb@sq.com (Mark Brader)
- Subject: Re: Is a diagnostic required?
- Message-ID: <1996Feb29.185548.29183@sq.com>
- Organization: SoftQuad Inc., Toronto, Canada
- References: <1996Feb23.090526.7591@sq.com> <danpop.824999740@rscernix> <218226403wnr@pires.co.uk>
- Date: Thu, 29 Feb 1996 18:55:48 GMT
-
- In the context of this question:
- > > > Does the following code require a diagnostic?
- > > > foo() { }
- > > > main() { foo(3); } >
-
- More than 90 lines of my posting were then quoted to respond to one sentence:
- > > I must say it's rather disgusting that none of the compilers Dan tried was
- > > was smart and helpful enough to produce the diagnostic anyway -- it would
- > > after all be easy enough for them to do so in this case.
-
- As follows:
- > Don't be too unfair to the compiler writers - they're trying to write
- > compilers that accept K&R C as well as ISO C. You may not think this is a
- > good idea, but there's vast amounts of legacy code with K&R header
- > files out there....
-
- I have no objection to a compiler choosing to *accept* this code, only to
- its doing so silently. Even in K&R1, it was not exactly blessed; page 71
- does say that it will be "generally" safe, but the actual definition of
- function calls on page 168 makes no such promise. 17 or 18 years have
- passed since K&R1 appeared, and I don't believe that silent acceptance
- of such code, when the mismatch could easily be diagnosed, is doing
- anyone a favor.
-
- (As I said the last time, I withdraw the objection if the compiler is one
- intended to be used with a separate lint-type checker.)
- --
- Mark Brader, msb@sq.com "Constrain your data early and often."
- SoftQuad Inc., Toronto -- C. M. Sperberg-McQueen
-
- My text in this article is in the public domain.
-